import React from 'react';
import {localParam} from "../../../components/common/function";

export default class ContentComponent extends React.Component{
    constructor(){
        super();
        this.state={
            good:[]
        }
    }
    componentWillMount() {
        this.getData();
    }
    getData(){
        let gid =decodeURIComponent(localParam(this.props.location.search).search.gid);
        fetch('http://vueshop.glbuys.com/api/home/goods/info?gid='+gid+'&type=details&token=1ec949a15fb709370f')
            .then((res)=>{
                return res.json()
            }).then(res=>{
            console.log(res.data);
            if (res.code === 200) {
                this.setState({good:res.data})
            }
        });
    }

    render() {
        return(
            <div>
                <div style={{marginTop:'80px'}} dangerouslySetInnerHTML={{__html:this.state.good.bodys}}>

                </div>
            </div>
        )
    }
}